-
Notifications
You must be signed in to change notification settings - Fork 17
Support numba 0.62+ #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add ninja as a requirement to build LLVM openmp libraries fast and reliably - Update numba dependency to 0.62.x - Export LLVM config dir from miniconda3
- Update building of openmp libraries for LLVM 20 - Add patches for standalone building and linking statically LLVM - Use ninja for faster builds - Add more printouts in setup - Use build_wheel directly from setuptools since we require a recent version
- Avoid multiple registration issues when using run_static_constructors from the execution engine, which re-iterates every module
- Update libomptarget nvptx device RTL path - Use the new pass manager - Optimize toolchain code generation for the CUDA target
- Remove deprecetad nvvm.annotatios for CUDA kernel and use ptx_kernel calling convention instead - Replace startswith with starts_with - Ddd default dummy argument to device kernel as expected by thee runtime - Set thread limit for cpu device(1) target regions - Fix basic block move code to use eraseFromParent, insertInto - Update tgt_register_lib and tgt_unregister_lib handling in ctor
- Use opaque pointer types - Handle nodiscard APIs
- Include in the wheel only strictly necessary files via updating MANIFEST.in - Update setup.py to forward CC, CXX flags and avoid default cmake system includes for manylinux building
56684b4 to
17bd554
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR upgrades PyOMP to support Numba 0.62+ by updating the underlying LLVM infrastructure from version 15.0.7 to 20.1.8. This is a significant upgrade that involves extensive changes to adapt to new LLVM APIs and conventions, particularly around the new pass manager, opaque pointers, and OpenMP runtime interfaces.
Changes:
- Updated LLVM from version 15.0.7 to 20.1.8 with corresponding API adaptations
- Migrated from the legacy pass manager to the new pass builder API
- Adapted to LLVM's opaque pointer representation (removing type-specific pointer APIs)
- Updated OpenMP runtime library integration (generic bitcode files instead of architecture-specific)
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/numba/openmp/omp_ir.py | Updated pass builder API, generic libomptarget bitcode path, improved ptxas integration |
| src/numba/openmp/omp_lower.py | Changed thread limit default from 1 to 0 for runtime default |
| src/numba/openmp/llvm_pass.py | Added debug output for bitcode intermediate files |
| src/numba/openmp/libs/pass/IntrinsicsOpenMP.cpp | Replaced startswith with starts_with for LLVM 20 compatibility, added module verification |
| src/numba/openmp/libs/pass/CGIntrinsicsOpenMP.cpp | Updated to opaque pointers, replaced moveBefore with insertInto, added error handling for createBarrier, simplified registration logic |
| src/numba/openmp/libs/pass/CGIntrinsicsOpenMP.h | Updated toString signature for const reference |
| src/numba/openmp/libs/pass/CMakeLists.txt | Removed -flto flags from linker options |
| src/numba/openmp/tests/test_openmp.py | Simplified test to use thread_limit on target directive |
| src/numba/openmp/config.py | Changed OPENMP_DEVICE_TOOLCHAIN default from 0 to 1 |
| src/numba/openmp/compiler.py | Updated to explicitly call OpenMP descriptor registration functions |
| setup.py | Updated to download full llvm-project tarball, extract only needed subdirs, added Ninja generator, added CC/CXX forwarding |
| pyproject.toml | Added ninja build dependency, updated numba dependency range, updated CI configuration for LLVM 20.1.8 |
| buildscripts/** | Updated LLVM version references and build configurations |
| .github/workflows/build-upload-wheels.yml | Updated LLVM version, Python/Numba test matrix |
| .gitlab/jobs/tioga.yml | Added Python 3.14 to test matrix |
| buildscripts/conda-recipes/pyomp/meta.yaml | Updated LLVM version, numba version, added clangxx dependency, updated test expectations for generic bitcode files |
| buildscripts/cibuildwheel/setup-miniconda3.sh | Added clangxx to conda environment |
| README.md | Added version 0.5.x with Numba 0.62.x - 0.63.x to compatibility matrix |
| MANIFEST.in | Made file inclusion explicit with specific extensions |
| src/numba/openmp/libs/libomp/patches/20.1.8/*.patch | Added patches for LLVM 20.1.8 standalone build |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Expected by libomptarget to avoid a warning. Should not affect correctness. Makes GPU execution more CPU-efficient by avoiding spinning on GPU sync.
- Avoid dummy kernel argument for robust codegen
- Other packages (e.g., numba 0.62+, openblas) may require llvm-openmp and bundling our own creates conflicst.
- Build libomp and libomptarget selectively to customize for different packaging systems (conda or pypi) and platforms. We use the native libomp and build libomptarget as needed to avoid conflicts. - Rename libomp to openmp as it stores both libomp and libomptarget built libraries - Update python to refer to the renamed directory when finding libraries. - Raise an error if init expects to find a library
- Defined env vars to build bundled openmp libraries - Use clang for libomptarget as required - Add zstd, libffi dependencies to the conda environment
Upgrade for numba 0.62+ versions.
Will be release 0.5.x